package cn.wisteria._string;

import com.google.common.base.CaseFormat;
import com.google.common.base.Joiner;
import com.google.common.base.Splitter;

/**
 * <p>
 * 字符串的拼接
 * </p>
 *
 * @author: zhu.chen
 * @date: 2021/3/26
 * @version: v1.0.0
 */
public class StringMain {

    public static void main(String[] args) {
        /**
         * 字符串拼接：Herry;Ron;Hermione
         */
        System.out.println(Joiner.on(";").skipNulls().join("Herry", null, "Ron", "Hermione"));

        /**
         * 字符串切割：[foo, bar, qux]
         */
        System.out.println(Splitter.on(',').trimResults().omitEmptyStrings().splitToList("foo,bar,,   qux"));

        /**
         * 字符串的大小写转换：constantName
         */
        System.out.println(CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "CONSTANT_NAME"));
    }

}
